package com.woniuxy.lrz.carlproject;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.context.annotation.Bean;
import org.springframework.web.servlet.config.annotation.CorsRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@SpringBootApplication
@MapperScan("com.woniuxy.lrz.carlproject.dao")
@EnableCaching
public class CarlprojectApplication {

    public static void main(String[] args) {
        SpringApplication.run(CarlprojectApplication.class, args);
    }

    //配置跨域  和拦截器冲突？
//    @Bean
//    public WebMvcConfigurer webMvcConfigurer(){
//        return new WebMvcConfigurer() {
//            @Override
//            public void addCorsMappings(CorsRegistry registry) {
//                registry.addMapping("/**")
//                        .allowedOrigins("*")
//                        .allowedMethods("PUT","POST","GET","DELETE")
//                        .allowedHeaders("*");
//            }
//        };
//    }

}
